home *** CD-ROM | disk | FTP | other *** search
- import java.applet.*;
- import java.awt.*;
-
-
- public class emonitor extends Applet {
-
- public void init() {
- myPanel mp = new myPanel();
- myButton mb = new myButton("Press Me");
- mp.add( mb );
- add(mp);
-
- }
-
- public boolean postEvent(Event e) {
- System.out.println("At postEvent() in Applet");
- return super.postEvent(e);
- }
-
- public boolean handleEvent(Event evt) {
- System.out.println("At handleEvent() in Applet");
- return super.handleEvent(evt);
- }
- public boolean action(Event evt, Object arg) {
- System.out.println("At action() in Applet");
- return super.action(evt,arg); // The action method in all components return false by default
- }
-
- }
-
- class myButton extends java.awt.Button {
-
- public myButton(String label) {
- super(label);
- }
-
- public boolean postEvent(Event e) {
- System.out.println("At postEvent() in Button");
- return super.postEvent(e);
- }
-
- public boolean handleEvent(Event evt) {
- System.out.println("At handleEvent() in Button");
- return super.handleEvent(evt);
- }
- public boolean action(Event evt, Object arg) {
- System.out.println("At action() in Button");
- return super.action(evt,arg); // The action method in all components return false by default
- }
- }
-
-
-
-
- class myPanel extends java.awt.Panel {
-
- public myPanel() {
- super();
- }
-
- public boolean postEvent(Event e) {
- System.out.println("At postEvent() in Panel");
- return super.postEvent(e);
- }
-
- public boolean handleEvent(Event evt) {
- System.out.println("At handleEvent() in Panel");
- return super.handleEvent(evt);
- }
- public boolean action(Event evt, Object arg) {
- System.out.println("At action() in Panel");
- return super.action(evt,arg); // The action method in all components return false by default
- }
- }
-
-
-
-